// Below of the comment block
(function () {
	var d = window.location.href,
		cb = document.getElementById('cm_block'),
		emo = document.getElementById('emo-bar'),
		total = document.getElementById('cm_total'),
		cmp = document.getElementById('cm_page'),
		cmr = document.getElementById('cm_reply_css'),
		cbContent = cb.innerHTML,
		cmItemId = [],
		cmItemContent = [],
		cmItemLevel = [],
		cmNum = 0,
		cmItemId_T = '',
		cmItemContent_T = '',
		cmItemLevel_T = '',
		h = 0,
		i = 0,
		j = 0,
		k = 0,
		skeleton = '',
		str_T1 = "",
		str_T2 = "";

	function finalize(el, str) {
		var a = str,
			b = " <i data-emo='http://kod-project.googlecode.com/svn/brain/emotion/",
			c = "' class='emo'></i>";
		a = a.replace(/^(<br ?\/?>|&nbsp;)+/i, "").replace(/(<br ?\/?>)+(:|;|\^|=)/ig, "<br> $2").replace(/^(&nbsp;|<br ?\/?>| <br ?\/?>)+/ig, "").replace(/<noscript>\@<a(.*?)<\/noscript>/, "").replace(/\s:dhf:/ig, b + "emo-dhf.png' title=':dhf:" + c).replace(/\s:logo:/ig, b + "logo.gif' title=':logo:" + c).replace(/\s:dhfq:/ig, b + "dhf.gif' title=':dhfq:" + c).replace(/\s:\)/g, b + "smile.gif' title=':)" + c).replace(/\s;\)/g, b + "wink.gif' title=';)" + c).replace(/\s:D/g, b + "haha.gif' title=':D" + c).replace(/\s=D/g, b + "hihi.gif' title='=D" + c).replace(/\s\^:D/g, b + "abovemehaha.gif' title='^:D" + c).replace(/\s\^\_?\^/g, b + "senyum-tulus.gif' title='^_^" + c).replace(/\s:\(/g, b + "sad.gif' title=':(" + c).replace(/\s=\(/g, b + "sadanimated.gif' title='=(" + c).replace(/\s@@,/g, b + "rolleyes.gif' title='@@," + c).replace(/\s:yaya:/ig, b + "yaya.gif' title=':yaya:" + c).replace(/\s:s/ig, b + "sullen.gif' title=':s" + c).replace(/\s:(\\|\/)/ig, b + "memble.gif' title=':&#92;" + c).replace(/\s:('|\&\#39\;)\(/g, b + "cry.gif' title=':&#39;(" + c).replace(/\s:waaa:/ig, b + "wawa.gif' title=':waaa:" + c).replace(/\sT\_T/ig, b + "tears.gif' title='T_T" + c).replace(/\sB\)/g, b + "cool.gif' title='B)" + c).replace(/\s:Q/g, b + "smoking.gif' title=':Q" + c).replace(/\s\*\*p/ig, b + "crazy.gif' title='**p" + c).replace(/\s7:\(/g, b + "conf.gif' title='7:(" + c).replace(/\s(:|=)p\*/ig, b + "ball2.gif' title='=p*" + c).replace(/\s:p/ig, b + "wee.gif' title=':p" + c).replace(/\s:Oz+/ig, b + "sleep.gif' title=':Ozz" + c).replace(/\s7:O/ig, b + "angry.gif' title='7:O" + c).replace(/\s\\o\//ig, b + "applause.gif' title='&#92;o/" + c).replace(/\s\\m\//ig, b + "metal.gif' title='&#92;m/" + c).replace(/\s(&lt;3|:\*)/g, b + "love.gif' title='&amp;amp;lt;3" + c).replace(/\s0:\)/g, b + "angelgreen.gif' title='0:)" + c).replace(/\s\^o\^/ig, b + "angelwhite.gif' title='^o^" + c).replace(/\s:\-a/ig, b + "vomit.gif' title=':-a" + c).replace(/\s\*fck\*/ig, b + "fuck.gif' title='*fck*" + c).replace(/\sxV/ig, b + "demo.gif' title='xV" + c).replace(/\sx@/g, b + "marahbesar.gif' title='x@" + c).replace(/\sX@/ig, b + "arrgh.gif' title='X@" + c).replace(/\s:\-d/g, b + "top.gif' title=':-d" + c).replace(/\s:\-bd/g, b + "topmarkotop.gif' title=':-bd" + c).replace(/\s\~x\(+/ig, b + "ugh.gif' title='~x(" + c).replace(/\s:bye:/ig, b + "bye.gif' title=':bye:" + c).replace(/\s:W/g, b + "explain.gif' title=':W" + c).replace(/\s\(\-\.\-,\)/g, b + "pumpkin.gif' title='(-.-,)" + c).replace(/\s\*=p/ig, b + "ball1.gif' title='*=p" + c).replace(/\s:(imhere|disini):/ig, b + "imhere.gif' title=':disini:" + c).replace(/\s:cendol:/ig, b + "cendol.gif' title=':cendol:" + c).replace(/\s&lt;:\)/g, b + "festival1.gif' title='&amp;amp;lt;:)" + c).replace(/\s&lt;=\)/g, b + "festival2.gif' title='&amp;amp;lt;=)" + c).replace(/\s:(rolled|guling):/ig, b + "rolled.gif' title=':guling:" + c).replace(/\s\*bang\*/ig, b + "bang.gif' title='*bang*" + c).replace(/\s\'\'J/ig, b + "call.gif' title='&#39;&#39;J" + c).replace(/\s:drummer:/ig, b + "drummer.gif' title=':drummer:" + c).replace(/\s:(guitarist|gitaris):/ig, b + "guitarist.gif' title=':gitaris:" + c).replace(/\s:(vocalist|vokalis):/ig, b + "vocalist.gif' title=':vokalis:" + c).replace(/\[note\](.*?)\[\/note\]/ig, "<cite class='note'>$1<\/cite>").replace(/\[(youtube|iframe)\](.*?)\[\/(youtube|iframe)\]/ig, "<iframe class='loader video' data-src='$2' frameborder='0'><\/iframe>").replace(/<em rel="note">(.*?)<\/em>/ig, "<cite class='note'>$1</cite>").replace(/<i rel="code">(.*?)<\/i>/ig, "<code>$1</code>").replace(/<b rel="h([0-6])">(.*?)<\/b>/ig, "<h$1>$2</h$1>").replace(/<i rel="anchor">(.*?)<\/i>/ig, "<a class='allow' href='$1'>\{link\}</a>").replace(/<i rel="image">(.*?)<\/i>/ig, "<img class='center incomment' data-src='$1' alt='Loading...'>");
		el.innerHTML = a
	}

	function isoldIE() {
		var a = -1;
		if(navigator.appName == 'Microsoft Internet Explorer') {
			var b = navigator.userAgent;
			var c = new RegExp("MSIE ([0-9]{1,}[.0-9]{0,})");
			if(c.exec(b) !== null) a = parseFloat(RegExp.$1)
		}
		return a
	}
	var e = isoldIE();
	if(e == -1 || e >= 9) {
		while(cbContent.search(/<div id\=\"c[0-9]+/) != -1) {
			i = cbContent.indexOf('id="c');
			cbContent = cbContent.substring(i + 4);
			i = cbContent.indexOf('"');
			cmItemId[cmNum] = cbContent.substring(0, i);
			cbContent = cbContent.substring(i);
			if(/c[0-9]+/.test(cmItemId[cmNum]) && document.getElementById(cmItemId[cmNum])) {
				cmItemContent[cmNum] = document.getElementById(cmItemId[cmNum]).innerHTML;
				cmItemLevel[cmNum] = 0;
				cmNum++
			}
		}
		for(i = 0; i < cmNum - 1; ++i) {
			for(j = i + 1; j < cmNum; ++j) {
				if(cmItemContent[j].indexOf(cmItemId[i]) != -1) {
					cmItemId_T = cmItemId[j];
					cmItemContent_T = cmItemContent[j];
					cmItemLevel[j] = cmItemLevel[i] + 1;
					cmItemLevel_T = cmItemLevel[j];
					for(h = i + 1; h < j; ++h) {
						if(cmItemLevel[h] < cmItemLevel_T) {
							break
						}
					}
					for(k = j; k > h; k = k - 1) {
						cmItemId[k] = cmItemId[k - 1];
						cmItemContent[k] = cmItemContent[k - 1];
						cmItemLevel[k] = cmItemLevel[k - 1]
					}
					cmItemId[h] = cmItemId_T;
					cmItemContent[h] = cmItemContent_T;
					cmItemLevel[h] = cmItemLevel_T
				}
			}
		}
		for(i = 0; i < cmNum; ++i) {
			j = cmItemContent[i].indexOf('">@<a href="#c');
			if(j != -1) {
				str_T1 = cmItemContent[i].substring(0, j + 2);
				str_T2 = cmItemContent[i].substring(j + 1);
				j = str_T2.indexOf('</a>');
				str_T2 = str_T2.substring(j + 4);
				cmItemContent[i] = str_T1 + str_T2
			}
			j = cmItemContent[i].indexOf('class="cm_wrap ');
			if(j != -1) {
				str_T1 = cmItemContent[i].substring(0, j);
				str_T2 = cmItemContent[i].substring(j);
				if(cmItemLevel[i] > 5) cmItemLevel[i] = 5;
				cmItemContent[i] = str_T1 + 'style="width:' + (100 - cmItemLevel[i] * 5) + '%;" ' + str_T2
			}
			skeleton += cmItemContent[i]
		}
		finalize(cb, skeleton);
		cb.style.visibility = 'visible';
		var f = total.innerHTML,
			n = parseInt(f, 10);
		if(n > 200) {
			skeleton = '<div class="float-left">Page ';
			var g = (n - n % 200) / 200 + 1,
				o = '',
				p = 1;
			i = d.indexOf('.html');
			if(i != -1) {
				o = d.substring(0, i + 5)
			} else {
				o = d
			}
			i = o.indexOf('#comments');
			if(i != -1) {
				o = o.substring(0, i)
			}
			i = d.indexOf('?commentPage=');
			if(i == -1) {
				p = 1
			} else {
				p = parseInt(d.substring(i + 13), 10)
			}
			for(i = 1; i <= g; ++i) {
				if(i == p) {
					skeleton += '<span>' + i + '</span>'
				} else {
					skeleton += '<a href="' + o + '?commentPage=' + i + '#comments">' + i + '</a>'
				}
			}
			if(p * 200 <= n) {
				skeleton += '</div><div class="float-right">' + (((p - 1) * 200) + 1) + ' - ' + (p * 200) + ' of ' + n + ' comments</div>'
			} else {
				skeleton += '</div><div class="float-right">' + (((p - 1) * 200) + 1) + ' - ' + n + ' of ' + n + ' comments</div>'
			}
			cmp.innerHTML = skeleton;
			cmp = document.getElementById('cm_page_copy');
			cmp.innerHTML = skeleton;
			if(p < g) {
				skeleton = '<style type="text/css">.cmauthor_reply{display:none}</style>';
				cmr.innerHTML = skeleton
			}
		}
	} else {
		finalize(cb, '<h4><em>Old IE Suck!</em></h4>')
	}
	finalize(emo, emo.innerHTML)
})();
